﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;

namespace CPPEI.Coolzon.UI
{
    public class TabHeader : ButtonBase
    {
        static TabHeader()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(TabHeader), new FrameworkPropertyMetadata(typeof(TabHeader)));
            
        }
        public string Caption
        {
            get
            {
                return (string)GetValue(CaptionProperty);
            }
            set
            {
                SetValue(CaptionProperty, value);
            }
        }
        public UI.Part Part { get; set; }

        public static DependencyProperty CaptionProperty = DependencyProperty.Register("Caption",
            typeof(string),
            typeof(TabHeader),
            null);

        public bool IsSelected
        {
            get
            {
                return (bool)GetValue(IsSelectedProperty);
            }
            set
            {
                SetValue(IsSelectedProperty, value);
            }
        }

        public static DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected",
            typeof(bool),
            typeof(TabHeader),
            null);


        #region XProperties

        public ImageSourceFile XHeaderBackgroundImage
        {
            get
            {
                return (ImageSourceFile)GetValue(XHeaderBackgroundImageProperty);
            }
            set
            {
                SetValue(XHeaderBackgroundImageProperty, value);
            }
        }

        public double XHeaderHeight
        {
            get
            {
                return (double)GetValue(XHeaderHeightProperty);
            }
            set
            {
                SetValue(XHeaderHeightProperty, value);
            }
        }

        public double XHeaderWidth
        {
            get
            {
                return (double)GetValue(XHeaderWidthProperty);
            }
            set
            {
                SetValue(XHeaderWidthProperty, value);
            }
        }

        public Thickness XHeaderPadding
        {
            get
            {
                return (Thickness)GetValue(XHeaderPaddingProperty);
            }
            set
            {
                SetValue(XHeaderPaddingProperty, value);
            }
        }

        public BrushEx XHeaderForeground
        {
            get
            {
                return (BrushEx)GetValue(XHeaderForegroundProperty);
            }
            set
            {
                SetValue(XHeaderForegroundProperty, value);
            }
        }

        public double XHeaderFontSize
        {
            get
            {
                return (double)GetValue(XHeaderFontSizeProperty);
            }
            set
            {
                SetValue(XHeaderFontSizeProperty, value);
            }
        }

        public FontFamily XHeaderFont
        {
            get
            {
                return (FontFamily)GetValue(XHeaderFontProperty);
            }
            set
            {
                SetValue(XHeaderFontProperty, value);
            }
        }

        #region active
        public ImageSourceFile XActiveHeaderBackgroundImage
        {
            get
            {
                return (ImageSourceFile)GetValue(XActiveHeaderBackgroundImageProperty);
            }
            set
            {
                SetValue(XActiveHeaderBackgroundImageProperty, value);
            }
        }

        public double XActiveHeaderHeight
        {
            get
            {
                return (double)GetValue(XActiveHeaderHeightProperty);
            }
            set
            {
                SetValue(XActiveHeaderHeightProperty, value);
            }
        }

        public double XActiveHeaderWidth
        {
            get
            {
                return (double)GetValue(XActiveHeaderWidthProperty);
            }
            set
            {
                SetValue(XActiveHeaderWidthProperty, value);
            }
        }

        public Thickness XActiveHeaderPadding
        {
            get
            {
                return (Thickness)GetValue(XActiveHeaderPaddingProperty);
            }
            set
            {
                SetValue(XActiveHeaderPaddingProperty, value);
            }
        }

        public BrushEx XActiveHeaderForeground
        {
            get
            {
                return (BrushEx)GetValue(XActiveHeaderForegroundProperty);
            }
            set
            {
                SetValue(XActiveHeaderForegroundProperty, value);
            }
        }

        public double XActiveHeaderFontSize
        {
            get
            {
                return (double)GetValue(XActiveHeaderFontSizeProperty);
            }
            set
            {
                SetValue(XActiveHeaderFontSizeProperty, value);
            }
        }

        public FontFamily XActiveHeaderFont
        {
            get
            {
                return (FontFamily)GetValue(XActiveHeaderFontProperty);
            }
            set
            {
                SetValue(XActiveHeaderFontProperty, value);
            }
        }
        #endregion

        #endregion

        #region Dependency Properties

        public static DependencyProperty XHeaderBackgroundImageProperty = DependencyProperty.Register("XHeaderBackgroundImage",
            typeof(ImageSourceFile),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderHeightProperty = DependencyProperty.Register("XHeaderHeight",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderWidthProperty = DependencyProperty.Register("XHeaderWidth",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderPaddingProperty = DependencyProperty.Register("XHeaderPadding",
            typeof(Thickness),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderForegroundProperty = DependencyProperty.Register("XHeaderForeground",
            typeof(BrushEx),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderFontSizeProperty = DependencyProperty.Register("XHeaderFontSize",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XHeaderFontProperty = DependencyProperty.Register("XHeaderFont",
            typeof(FontFamily),
            typeof(TabHeader),
            null);

        #region active

        public static DependencyProperty XActiveHeaderBackgroundImageProperty = DependencyProperty.Register("XActiveHeaderBackgroundImage",
            typeof(ImageSourceFile),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderHeightProperty = DependencyProperty.Register("XActiveHeaderHeight",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderWidthProperty = DependencyProperty.Register("XActiveHeaderWidth",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderPaddingProperty = DependencyProperty.Register("XActiveHeaderPadding",
            typeof(Thickness),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderForegroundProperty = DependencyProperty.Register("XActiveHeaderForeground",
            typeof(BrushEx),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderFontSizeProperty = DependencyProperty.Register("XActiveHeaderFontSize",
            typeof(double),
            typeof(TabHeader),
            null);
        public static DependencyProperty XActiveHeaderFontProperty = DependencyProperty.Register("XActiveHeaderFont",
            typeof(FontFamily),
            typeof(TabHeader),
            null);

        #endregion

        #endregion

        public TabHeader(UI.Part part)
        {
            this.Part = part;
            this.Caption = this.Part.XCaption;
           
        }
    }
}
